<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="<?=domain?>static/style/manage.css" rel="stylesheet" type="text/css" />
<link href="<?=domain?>static/style/fancybox.css" rel="stylesheet" type="text/css" />
<link href="<?=domain?>static/style/datepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=domain?>static/scripts/core.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/fancybox.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/datepicker.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/manage.js" charset="utf-8"></script>
<title><?=name?></title>
<body class="hoariness">
<div class="head">
	<div class="area">
		<div class="logo">网站联盟管理后台</div>
		<div class="parent">
			<div class="nav">
				<ul>
					<?php
						foreach($menu as $key=>$value){
							echo '<li><a href="'.domain.'index.php?c='.$value['child'][0]['controller'].'&a='.$value['child'][0]['method'].'" class="'.(stristr($value['controller'],$this->request['controller'])?'sel':'').'">'.$value['name'].'</a></li>';
						}
					?>
	    		</ul>
			</div>
			<div class="user">欢迎您&nbsp;<?=$name?>&nbsp;,<a href="<?=domain?>index.php?c=manage&a=out">【退出】</a></div>
		</div>
	</div>
	<div class="child">
		<div class="nav">
			<?php
				$controller=0;$method=0;
				foreach($menu as $k=>$v){
					if(stristr($v['controller'],$this->request['controller'])){
						$controller=$k;
						echo '<ul class="sel '.$v['controller'].'">';
					}else{
						echo '<ul class="'.$v['controller'].'">';
					}
					foreach($v['child'] as $key=>$value){
						if($value['method']==$this->request['method']&&$value['controller']==$this->request['controller']){
							$method=$key;
						}
						echo '<li class="'.$value['method'].'"><a href="'.domain.'index.php?c='.$value['controller'].'&a='.$value['method'].'">'.$value['name'].'</a></li>';
					}
					echo '</ul>';
				}
			?>
		</div>
		<div class="place">当前位置:<?=$menu[$controller]['name']?>&nbsp;>&nbsp;<?=$menu[$controller]['child'][$method]['name']?></div>
	</div>
</div>
<div class="work">
	<div class="form">
		<h3 class="real">
           <div class="m"><?=$menu[$controller]['child'][$method]['name']?></div>
           <?php if(isset($purview['finance']['excel'])){?><a href="<?=$excel?>" class="hd add">导出Excel</a><?php }?>
           <div class="search">
          		<form name="home" method="GET" action="<?=domain?>index.php" accept-charset="UTF-8">
  				<input type="hidden" name="c" value="finance"/><input type="hidden" name="a" value="index"/>
  				<div class="select">
  					<a href="#"><label>设置搜索条件</label><span></span></a>
  					<div class="box">
		           		<table class="fix">
							<thead>
								<tr>
									<th>日期:</th>
									<th><input type="text" name="date" value="<?=(isset($date)&&count($date)==2?$date[0].','.$date[1]:'');?>" size="23"/></th>
								</tr>
								<tr>
									<th>状态:</th>
									<th>
										<label><input type="checkbox" name="locked[]" value="0"<?=(!isset($locked)||isset($locked[0])?' checked':'')?>/><span>已支付</span></label>
		   								<label><input type="checkbox" name="locked[]" value="1"<?=(!isset($locked)||isset($locked[1])?' checked':'')?>/><span>未支付</span></label>
									</th>
								</tr>
							</thead>
						</table>
				   	</div>
  				</div>
  				<div class="input"><input type="text" name="search" value="<?=$search?>" maxlength="60" search="true"<?=(empty($search)?'':' class="wipe"')?>/></div>
		        <div class="tab select">
			        <a href="#"><label>帐号</label><input type="hidden" name="tab" value="account"/><span></span></a>
		           	<ul>
				   	  <li tab="account"<?=($tab=='account'?' selected':'')?>><a href="#">帐号</a></li>
					  <li tab="name"<?=($tab=='name'?' selected':'')?>><a href="#">姓名</a></li>
					  <li tab="mail"<?=($tab=='mail'?' selected':'')?>><a href="#">成员</a></li>
			   		</ul>
		        </div>
		        <div class="submit"><input type="submit" name="filter" value="搜索" class="yellow"/></div>
		        </form>
           </div>
        </h3>
		 <table class="fix">
			<thead>
				<tr>
					<th><input type="checkbox" name="all" value="" id="input_all"/></th>
					<th>成员</th>
					<th>银行</th>
					<th>地区</th>
					<th>银行帐号</th>
					<th>姓名</th>
					<th><a href="<?=$basic?>&order=deduction&rule=<?=($rule=='desc'&&$order=='deduction'?'asc':'desc')?>">税前</a><?php if($order=='deduction'){?><span class="<?=$rule?>"></span><?php }?></th>
					<th>缴税</th>
					<th>手续费</th>
					<th>实际支付</th>
					<th><a href="<?=$basic?>&order=date&rule=<?=($rule=='desc'&&$order=='date'?'asc':'desc')?>">支付日期</a><?php if($order=='date'){?><span class="<?=$rule?>"></span><?php }?></th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php
				foreach($payment as $value){
				?>
				<tr>
					<td><input type="checkbox" name="id[]" value="<?=$value['id']?>"/></td>
					<td><?=$value['mail']?></td>
					<td><?=$sort[$value['company']]['name']?></td>
					<td><?=$sort[$value['province']]['name']?></td>
					<td><?=$value['account']?></td>
					<td><?=$value['name']?></td>
					<td><?=$value['deduction']?></td>
					<td><?=$value['tax']?></td>
					<td><?=$value['outlay']?></td>
					<td><?=$value['fact']?></td>
					<td><?=date('Y-m-d',$value['date'])?></td>
					<td><?=$value['locked']==0?'已支付':'待支付'?></td>
					<td>
						<?php if(isset($purview['finance']['locked'])){?><a href="<?=(domain.'index.php?c=finance&a=locked&id='.$value['id'])?>" action="RequestA" mixed="confirm:true,sub:{locked:<?=($value['locked']==0?1:0)?>}"><?=$value['locked']==0?'撤销':'支付'?></a>&nbsp;<?php }?>
					</td>
				</tr>
				<?php
				}
				?>
			</tbody>
		</table>
		<div class="batch">
			<span><label for="input_all">全选</label></span>
			<?php if(isset($purview['finance']['locked'])){?><span><a href="<?=(domain.'index.php?c=finance&a=locked&locked=0')?>" action="RequestBa">批量支付</a></span><?php }?>
			<?php if(isset($purview['finance']['locked'])){?><span><a href="<?=(domain.'index.php?c=finance&a=locked&locked=1')?>" action="RequestBa">批量撤销</a></span><?php }?>
		</div>
	</div>
	<div class="pagination"><?=$pagination?>&nbsp;&nbsp;<font>共<?=$total?>条记录</font></div>
</div>
<div class="footer">
	<div class="credits">Power by <a href="http://www.cnadlm.com" target="_blank">cnadlm.com</a></div>
	<div class="connect">
		<a href="http://www.cnadlm.com" target="_blank">系统升级</a>
		<a href="http://www.cnadlm.com/help.html" target="_blank">帮助文档</a>
	</div>
</div>
</body>
</html>
<script language="JavaScript" type="text/javascript">
 $('input[name="date"]').DatePicker({
 	<?=isset($date)?'date:["'.$date[0].'","'.$date[1].'"],':''?>
	position:'bottom',
	calendars:2,
	mode:'range',
	onBeforeShow:function(){
		$('input[name="date"]').parents('.select').attr('lock','true');
	},
	onChange:function(formated){
		formated=formated.toString();
		if(formated.indexOf('1970-01-01')==-1){
			$('input[name="date"]').val(formated);
			$('input[name="date"]').DatePickerHide();
		}
	},
	onHide:function(){
		$('input[name="date"]').parents('.select').removeAttr('lock');
	}
});
</script>